package com.neuedu.controller;


import com.neuedu.pojo.ItemAccount;
import com.neuedu.pojo.ItemProtocol;
import com.neuedu.service.IItemAccountService;
import com.neuedu.service.IItemProtocolService;
import com.neuedu.util.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author han
 * @since 2020-09-23
 */
@RestController
@RequestMapping("/item-protocol")
public class ItemProtocolController {
    @Resource
    IItemProtocolService itemProtocolService;
    @PostMapping("/save")
    CommonResult save(ItemProtocol itemProtocol) {
        return CommonResult.success(itemProtocolService.saveOrUpdate(itemProtocol));
    }
    @GetMapping("/getByItemId")
    CommonResult getByUserId(Integer itemId) {
        return CommonResult.success(itemProtocolService.getByItemId(itemId));
    }


}
